package com.atyuntuku.yuntuku.service;

import com.atyuntuku.yuntuku.controller.request.PictureEditRequest;
import com.atyuntuku.yuntuku.controller.request.PictureQueryRequest;
import com.atyuntuku.yuntuku.controller.request.PictureUpdateRequest;
import com.atyuntuku.yuntuku.dto.file.PictureUploadRequest;
import com.atyuntuku.yuntuku.pojo.Picture;
import com.atyuntuku.yuntuku.vo.PictureVO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * ClassName: PictureService
 * Package: com.atyuntuku.yuntuku.service
 * Description:
 *
 * @Author qinglong wei
 * @Create 2025/10/11 11:42
 * @Version 1.0
 */
public interface PictureService extends IService<Picture> {
    public PictureVO uploadPicture(MultipartFile multipartFile, PictureUploadRequest pictureUploadRequest, HttpServletRequest request);

    //分页查询的条件构造器
    public QueryWrapper<Picture> getQueryWrapper(PictureQueryRequest pictureQueryRequest);

    //分页查询图片（用户）
    public Page<PictureVO> getPicturePage(PictureQueryRequest pictureQueryRequest);

    //分页查询转换为图片Vo分页
    public com.baomidou.mybatisplus.extension.plugins.pagination.Page<PictureVO> getPictureVo(Page<Picture> pages);

    //对于更新或者修改的图片进行校验
    public void validate(Picture picture);

    //更新图片信息
    public Boolean updatePicture(@RequestBody PictureUpdateRequest pictureUpdateRequest);

    //编辑图片（用户和管理员可以使用，但是用户只能改自己的）
    public Boolean editPicture(@RequestBody PictureEditRequest pictureEditRequest,HttpServletRequest request);
}


